const dataTimeFormat = l => val => val ? `${val.slice(l - 4, l - 2)}:${val.slice(l - 2, l)}` : '';

const dataTimeFormat4 = dataTimeFormat(4)

const dataTimeFormat12 = dataTimeFormat(12)

const dataTimeFormatAll = val => val.toString().replace(/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/, `$1-$2-$3 $4:$5`)
export {
  dataTimeFormat4,
  dataTimeFormat12,
  dataTimeFormatAll
}
